python [] for loop

23

def list_comprehension(xs):
    result = []
    for x in xs:
        if condition:
            result.append(f(x))
    return result

Comments

Submit
0 Comments